package com.jsmtr.rms.service;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jsmtr.rms.entity.*;
import com.jsmtr.rms.entity.vo.PassStateStatisticVo;
import org.springframework.transaction.annotation.Transactional;

public interface IUtilService {

    //生成返回结果Json数据
    public void printJsonResult(boolean state, String Message, String url, HttpServletResponse response);

    //生成返回结果Json数据
    public void printJsonResult(String json, HttpServletResponse response);

    //生成返回结果text数据
    public void printTextResult(String result, HttpServletResponse response);

    //获得当前登录用户

    /**
     * 获得当前登录用户
     *
     * @param request
     * @return 当前用户
     */
    public BaseUser getSessionUser(HttpServletRequest request);

    //获得当前登录内招用户
    public NZResume getNZUser(HttpServletRequest request);

    //获得内部招聘登录用户
    public BaseEmployee getEmployeeUser(HttpServletRequest request);

    void addObject(Object obj) throws Exception;

    @SuppressWarnings("rawtypes")
    void addList(List list) throws Exception;

    @SuppressWarnings("rawtypes")
    void addList(List dellist, List addlist) throws Exception;

    void editObject(Object obj) throws Exception;

    void editObject(Object editobj, Object addobj) throws Exception;

    @SuppressWarnings("rawtypes")
    void editObject(Object editobj, List addlist) throws Exception;

    @SuppressWarnings("rawtypes")
    void editList(List list) throws Exception;

    @SuppressWarnings("rawtypes")
    void editList(List editlist, Object addobj) throws Exception;

    @SuppressWarnings("rawtypes")
    void editList(List editlist, List addlist) throws Exception;

    @SuppressWarnings("rawtypes")
    void editList(Object editobj, List dellist, List addlist) throws Exception;

    @SuppressWarnings("rawtypes")
    void editList(List dellist, List editlist, List addlist) throws Exception;

    int editSqls(List<String> sqls) throws Exception;

    void delObject(Object delobj) throws Exception;

    @SuppressWarnings("rawtypes")
    void delList(List delList) throws Exception;

    @SuppressWarnings("rawtypes")
    void delList(List delList, List editlist) throws Exception;

    @SuppressWarnings("rawtypes")
    void delList(Object delobj, List editlist) throws Exception;

    void saveLog(SystemLog log) throws Exception;

    /**
     * 获得配置信息
     *
     * @param code 配置编号
     * @return 配置内容
     * @throws Exception
     */
    String getConfig(String code) throws Exception;

    /**
     * 获得配置信息
     *
     * @param code 配置编号
     * @return 配置对象
     * @throws Exception
     */
    BaseConfig findConfig(String code) throws Exception;

    /**
     * 获得配置信息
     *
     * @param groupid 配置分组编号
     * @return List<BaseConfig>
     * @throws Exception
     */
    List<BaseConfig> getConfigs(String groupid) throws Exception;

    /**
     * 创建流程实施结果
     * @param resume 应聘者简历
     * @param flow 当前流程
     * @param result 是否通过
     * @return DoFlowInfo
     * @throws Exception
     */
    //DoFlowInfo addFlowInfo(DUserResume resume,PlanInfoFlow flow,int result) throws Exception;

    /**
     * 创建流程实施结果
     * @param user 笔试人员信息
     * @param flow 当前流程
     * @return DoFlowInfo
     * @throws Exception
     */
    //DoFlowInfo addFlowInfo(DoExamUser user,PlanInfoFlow flow) throws Exception;

    /**
     * 创建流程实施结果
     * @param user 面试人员信息
     * @param flow 当前流程
     * @return DoFlowInfo
     * @throws Exception
     */
    //DoFlowInfo addFlowInfo(DoInterviewUser user,PlanInfoFlow flow) throws Exception;

    /**
     * 创建流程实施结果
     * @param user 背景调查人员信息
     * @param flow 当前流程
     * @return DoFlowInfo
     * @throws Exception
     */
    //DoFlowInfo addFlowInfo(DoPoliticalReviewUser user,PlanInfoFlow flow) throws Exception;

    /**
     * 创建流程实施结果
     * @param user 体检人员信息
     * @param flow 当前流程
     * @return DoFlowInfo
     * @throws Exception
     */
    //DoFlowInfo addFlowInfo(DoPhysicalUser user,PlanInfoFlow flow) throws Exception;

    /**
     * 创建流程实施结果
     * @param user 报到人员信息
     * @param flow 当前流程
     * @return DoFlowInfo
     * @throws Exception
     */
    //DoFlowInfo addFlowInfo(DoEmploymentUser user,PlanInfoFlow flow) throws Exception;


    /**
     * 获得招聘流程
     *
     * @param id 招聘流程ID
     * @return 招聘流程
     * @throws Exception
     */
    ProjectInfoFlow getFlow(String id) throws Exception;

    /**
     * 获得上一招聘流程
     * @param pid 招聘计划ID
     * @return 招聘流程
     * @throws Exception
     */
    //PlanInfoFlow getPrevFlow(String pid) throws Exception;

    /**
     * 获得下一招聘流程
     *
     * @param pid      招聘方案ID
     * @param deptcode 责任部门编码
     * @return 招聘流程
     * @throws Exception
     */
    ProjectInfoFlow getNextFlow(String pid, String deptcode) throws Exception;

    /**
     * 获得参与笔试人员
     *
     * @param page    当前页
     * @param perpage 每页显示条数
     * @param epid    笔试计划ID
     * @return Map<String, Object>
     * @throws Exception
     */
    Map<String, Object> getExamUsers(int page, int perpage, String epid) throws Exception;

    /**
     * 判断当前流程是否进行中
     *
     * @param flowid 招聘流程ID
     * @return true:进行中 ; false:未开始或者已结束
     */
    boolean FlowIsDoing(String flowid);

    /**
     * 获得某状态下简历数
     *
     * @param fid    招聘流程ID
     * @param result 处理状态
     * @return Double
     */
    Double getUserCount(String fid, int result);

    /**
     * 获得某状态下简历信息
     *
     * @param fid    招聘流程ID
     * @param result 处理状态
     * @return Double
     */
    List<DUserResume> getResumes(String fid, int result) throws Exception;

    List<DUserResume> getResumes(String pid) throws Exception;

    /**
     * 获得地址信息
     *
     * @return String 下拉列表选项
     */
    String getAddress();

    /**
     * 通过流程ID获得招聘方案
     *
     * @param fid 招聘流程ID
     * @return ProjectInfo
     */
    ProjectInfo getProjectByFid(String fid) throws Exception;

    String optionList(String tcode, String pid) throws Exception;

    List<BaseData> getBaseData(String tcode, String pid) throws Exception;

    BaseEmailConfig getEmailConfig() throws Exception;

    @Transactional(readOnly = true)
    BaseMessageConfig getMessageConfig() throws Exception;

    BaseRegtips getRegtips() throws Exception;

    String optionListById(String tcode, String pid) throws Exception;

    Map<String, Object> getJobs(int page, int perpage, String deptname, String jobname) throws Exception;

    List<ProjectInfoJobs> getProjectJobs(String projectId) throws Exception;

    DoZysx getUserZysx(String pid, String fid, String userid) throws Exception;

    DoMSConfirm getMSUserConfirm(String userid) throws Exception;

    DoMSConfirm getMSUserConfirm(String uid,String type) throws Exception;

    Map queryBySql(String sql) throws Exception;

    List<Duserremark> getDuserremark(Duserremark duserremark) throws Exception;

    List groupNomalStateByFid(String fid, String fname) throws Exception;

    List groupZZStateByFid(String fid, String fname) throws Exception;

    int getJobMaxID() throws Exception;

    List<Long> getTotalHumanNumber() throws Exception;

    List getAnnualHumanNumber() throws Exception;

    List<ProjectInfoFlow> getFlowsByPid(String id) throws Exception;

    List passStateStatistic(String keyword, String year) throws Exception;

    List distinctProjectYear() throws Exception;

}
